package pl.cezary.butler.walili.server.db.tasks;

import pl.cezary.butler.walili.common.User;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Przemysław Bałdyga
 */
public class CreateUserTask extends UpdateTask {

    private final String LOGIN;
    private final String HASLO;
    private static final Logger log = Logger.getLogger(CreateUserTask.class.getName());
   

    public CreateUserTask(User user) {
        this.LOGIN = user.getLogin();
        this.HASLO = user.getHaslo();
    }

    @Override
    public void execute() {
        getJdbcTemplate().insert("INSERT INTO users VALUES (?,?,?)",getIdFactory().generateId(),LOGIN,HASLO);        
    }
}
